with open("ips.txt","w+") as fp:
    import random
    lst = []
    for i in range(120000):
        num = random.randint(1,256)
        lst.append(f"172.25.254.{num}")
        fp.write(f"172.25.254.{num} \n ")
    dct = dict()
    for j in range(256):
        n = lst.count(f"172.25.254.{j+1}")
        dct[f"172.25.254.{j}"]= n
    for x in range(10):
        max_value = max(dct.values())
        max_key = list(dct.keys())[list(dct.values()).index(max_value)]
        print(f"出现频率排名第{x+1}的ip是{max_key},共出现{max_value}次")
        dct.pop(max_key)
